#include <iostream>
using namespace std;
#include <boost/smart_ptr.hpp>
using namespace boost;

int main()
{
	// declare a scoped pointer to an int
	scoped_ptr<int> x_scoped_ptr(new int(5));
	
	// Note, when using Visual C++ it is necessary to explicitly qualify the shared pointer being used
	// as Microsoft have released their own shared pointer defined within the standard namespace.
	// This is *not* necessary for Code::Blocks and GCC.
	boost::shared_ptr<int> y_shared_ptr(new int(6));
	boost::shared_ptr<int> z_shared_ptr = y_shared_ptr;

	// use smart pointers
	int x_on_the_stack = 3 + *x_scoped_ptr;
	cout << x_on_the_stack << endl;

	int y_on_the_stack = *y_shared_ptr + *z_shared_ptr;
	cout << y_on_the_stack << endl;

	return 0;
}


